github.com/alloyzeus/go-azfl@v0.0.0-20231220071816-9740126a2d07/azcore/session_subject.go (about)

     1  package azcore
     2  
     3  // SessionSubject is an object which could be involved in an action.
     4  type SessionSubject[
     5  	TerminalIDNumT TerminalIDNum, TerminalIDT TerminalID[TerminalIDNumT],
     6  	UserIDNumT UserIDNum, UserIDT UserID[UserIDNumT],
     7  ] interface {
     8  	AZSessionSubject()
     9  
    10  	// TerminalID returns the ref-key of the terminal for this subject.
    11  	TerminalID() TerminalIDT
    12  
    13  	// IsRepresentingAUser returns true if this subject is representing
    14  	// a user, i.e., the application is a user-agent, not a service application.
    15  	//
    16  	// If this method returns true, UserID must return a valid ref-key of
    17  	// the user.
    18  	IsRepresentingAUser() bool
    19  
    20  	// UserID returns the ref-key of the user this subject represents.
    21  	UserID() UserIDT
    22  }