@ -4,6 +4,8 @@
package ipnauth
package ipnauth
import (
import (
"context"
"tailscale.com/ipn"
"tailscale.com/ipn"
)
)
@ -17,18 +19,21 @@ var Self Actor = unrestricted{}
type unrestricted struct { }
type unrestricted struct { }
// UserID implements [Actor].
// UserID implements [Actor].
func ( u u nrestricted) UserID ( ) ipn . WindowsUserID { return "" }
func ( u nrestricted) UserID ( ) ipn . WindowsUserID { return "" }
// Username implements [Actor].
// Username implements [Actor].
func ( u unrestricted ) Username ( ) ( string , error ) { return "" , nil }
func ( unrestricted ) Username ( ) ( string , error ) { return "" , nil }
// Context implements [Actor].
func ( unrestricted ) Context ( ) context . Context { return context . Background ( ) }
// ClientID implements [Actor].
// ClientID implements [Actor].
// It always returns (NoClientID, false) because the tailscaled itself
// It always returns (NoClientID, false) because the tailscaled itself
// is not a connected LocalAPI client.
// is not a connected LocalAPI client.
func ( u u nrestricted) ClientID ( ) ( _ ClientID , ok bool ) { return NoClientID , false }
func ( u nrestricted) ClientID ( ) ( _ ClientID , ok bool ) { return NoClientID , false }
// CheckProfileAccess implements [Actor].
// CheckProfileAccess implements [Actor].
func ( u u nrestricted) CheckProfileAccess ( _ ipn . LoginProfileView , _ ProfileAccess , _ AuditLogFunc ) error {
func ( u nrestricted) CheckProfileAccess ( _ ipn . LoginProfileView , _ ProfileAccess , _ AuditLogFunc ) error {
// Unrestricted access to all profiles.
// Unrestricted access to all profiles.
return nil
return nil
}
}
@ -37,10 +42,10 @@ func (u unrestricted) CheckProfileAccess(_ ipn.LoginProfileView, _ ProfileAccess
//
//
// Deprecated: this method exists for compatibility with the current (as of 2025-01-28)
// Deprecated: this method exists for compatibility with the current (as of 2025-01-28)
// permission model and will be removed as we progress on tailscale/corp#18342.
// permission model and will be removed as we progress on tailscale/corp#18342.
func ( u u nrestricted) IsLocalSystem ( ) bool { return false }
func ( u nrestricted) IsLocalSystem ( ) bool { return false }
// IsLocalAdmin implements [Actor].
// IsLocalAdmin implements [Actor].
//
//
// Deprecated: this method exists for compatibility with the current (as of 2025-01-28)
// Deprecated: this method exists for compatibility with the current (as of 2025-01-28)
// permission model and will be removed as we progress on tailscale/corp#18342.
// permission model and will be removed as we progress on tailscale/corp#18342.
func ( u u nrestricted) IsLocalAdmin ( operatorUID string ) bool { return false }
func ( u nrestricted) IsLocalAdmin ( operatorUID string ) bool { return false }