Documentation ¶
Index ¶
- func AbortIfError(c *gin.Context, err error) bool
- func AlertIndex(c *gin.Context)
- func AlertMarkAllAsRead(c *gin.Context)
- func AlertMarkAsReadXHR(c *gin.Context)
- func AlertMarkAsUnreadXHR(c *gin.Context)
- func AlertShow(c *gin.Context)
- func BillingReportShow(c *gin.Context)
- func ComponentsIndex(c *gin.Context)
- func CreateNewAccountAlert(req *Request, newUser *pgmodels.User, token string) (*pgmodels.Alert, error)
- func CreatePasswordChangedAlert(req *Request, userToEdit *pgmodels.User) (*pgmodels.Alert, error)
- func CreatePasswordResetAlert(req *Request, userToEdit *pgmodels.User, token string) (*pgmodels.Alert, error)
- func DashboardShow(c *gin.Context)
- func DeletionRequestApprove(c *gin.Context)
- func DeletionRequestCancel(c *gin.Context)
- func DeletionRequestIndex(c *gin.Context)
- func DeletionRequestReview(c *gin.Context)
- func DeletionRequestShow(c *gin.Context)
- func DepositReportShow(c *gin.Context)
- func ErrorShow(c *gin.Context)
- func ErrorShowModal(c *gin.Context)
- func GenericFileIndex(c *gin.Context)
- func GenericFileInitDelete(c *gin.Context)
- func GenericFileInitRestore(c *gin.Context)
- func GenericFileRequestDelete(c *gin.Context)
- func GenericFileRequestRestore(c *gin.Context)
- func GenericFileShow(c *gin.Context)
- func InitObjectRestoration(obj *pgmodels.IntellectualObject, user *pgmodels.User) (*pgmodels.WorkItem, error)
- func InstitutionCreate(c *gin.Context)
- func InstitutionDelete(c *gin.Context)
- func InstitutionEdit(c *gin.Context)
- func InstitutionEditPrefs(c *gin.Context)
- func InstitutionIndex(c *gin.Context)
- func InstitutionNew(c *gin.Context)
- func InstitutionShow(c *gin.Context)
- func InstitutionUndelete(c *gin.Context)
- func InstitutionUpdate(c *gin.Context)
- func InstitutionUpdatePrefs(c *gin.Context)
- func IntellectualObjectEvents(c *gin.Context)
- func IntellectualObjectFiles(c *gin.Context)
- func IntellectualObjectIndex(c *gin.Context)
- func IntellectualObjectInitDelete(c *gin.Context)
- func IntellectualObjectInitRestore(c *gin.Context)
- func IntellectualObjectRequestDelete(c *gin.Context)
- func IntellectualObjectRequestRestore(c *gin.Context)
- func IntellectualObjectShow(c *gin.Context)
- func InternalMetadataIndex(c *gin.Context)
- func NsqAdmin(c *gin.Context)
- func NsqInit(c *gin.Context)
- func NsqShow(c *gin.Context)
- func OTPTokenIsExpired(tokenSentAt time.Time) bool
- func PremisEventIndex(c *gin.Context)
- func PremisEventShow(c *gin.Context)
- func PremisEventShowXHR(c *gin.Context)
- func ShowOpenSubMenu(auth *middleware.ResourceAuthorization) bool
- func SignInUser(c *gin.Context) (int, string, error)
- func StatusCodeForError(err error) (status int)
- func UserAuthyRegister(req *Request) error
- func UserChangePassword(c *gin.Context)
- func UserComplete2FASetup(c *gin.Context)
- func UserCompletePasswordReset(c *gin.Context)
- func UserCompleteSMSSetup(req *Request) error
- func UserConfirmPhone(c *gin.Context)
- func UserCreate(c *gin.Context)
- func UserDelete(c *gin.Context)
- func UserEdit(c *gin.Context)
- func UserGenerateBackupCodes(c *gin.Context)
- func UserGetAPIKey(c *gin.Context)
- func UserIndex(c *gin.Context)
- func UserInit2FASetup(c *gin.Context)
- func UserInitPasswordReset(c *gin.Context)
- func UserMyAccount(c *gin.Context)
- func UserNew(c *gin.Context)
- func UserSendForgotPasswordMessage(c *gin.Context)
- func UserShow(c *gin.Context)
- func UserShowChangePassword(c *gin.Context)
- func UserShowForgotPasswordForm(c *gin.Context)
- func UserSignIn(c *gin.Context)
- func UserSignInShow(c *gin.Context)
- func UserSignOut(c *gin.Context)
- func UserStartPasswordReset(c *gin.Context)
- func UserTwoFactorBackup(c *gin.Context)
- func UserTwoFactorChoose(c *gin.Context)
- func UserTwoFactorGenerateSMS(c *gin.Context)
- func UserTwoFactorPush(c *gin.Context)
- func UserTwoFactorVerify(c *gin.Context)
- func UserUndelete(c *gin.Context)
- func UserUpdate(c *gin.Context)
- func UserUpdateXHR(c *gin.Context)
- func WorkItemEdit(c *gin.Context)
- func WorkItemIndex(c *gin.Context)
- func WorkItemRedisDelete(c *gin.Context)
- func WorkItemRedisIndex(c *gin.Context)
- func WorkItemRequeue(c *gin.Context)
- func WorkItemShow(c *gin.Context)
- func WorkItemUpdate(c *gin.Context)
- type AlertReadResult
- type Deletion
- func NewDeletionForFile(genericFileID int64, currentUser *pgmodels.User, baseURL string) (*Deletion, error)
- func NewDeletionForObject(objID int64, currentUser *pgmodels.User, baseURL string) (*Deletion, error)
- func NewDeletionForReview(deletionRequestID int64, currentUser *pgmodels.User, baseURL, token string) (*Deletion, error)
- func (del *Deletion) CreateAndQueueWorkItem() (*pgmodels.WorkItem, error)
- func (del *Deletion) CreateApprovalAlert() (*pgmodels.Alert, error)
- func (del *Deletion) CreateCancellationAlert() (*pgmodels.Alert, error)
- func (del *Deletion) CreateRequestAlert() (*pgmodels.Alert, error)
- func (del *Deletion) CreateWorkItem() (*pgmodels.WorkItem, error)
- func (del *Deletion) QueueWorkItem() error
- func (del *Deletion) ReadOnlyURL() string
- func (del *Deletion) ReviewURL() (string, error)
- func (del *Deletion) WorkItemURL() (string, error)
- type DepositReportParams
- type Request
- type TwoFactorPreferences
- func (p *TwoFactorPreferences) DoNotUseTwoFactor() bool
- func (p *TwoFactorPreferences) MethodChanged() bool
- func (p *TwoFactorPreferences) NeedsAuthyConfirmation() bool
- func (p *TwoFactorPreferences) NeedsAuthyRegistration() bool
- func (p *TwoFactorPreferences) NeedsConfirmation() bool
- func (p *TwoFactorPreferences) NeedsSMSConfirmation() bool
- func (p *TwoFactorPreferences) NothingChanged() bool
- func (p *TwoFactorPreferences) PhoneChanged() bool
- func (p *TwoFactorPreferences) UseAuthy() bool
- func (p *TwoFactorPreferences) UseSMS() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbortIfError ¶
AbortIfError stops request processing and displays an error page if param err is not nil. This returns true if it actually did have to abort. When it returns true, the caller should return to ensure that no further processing of the request occurs. If this returns false, there was no error, and the caller can continue processing.
func AlertIndex ¶
AlertIndex shows list of alerts for the logged-in user, unless that user is sys admin, who can see all alerts. GET /alerts
func AlertMarkAllAsRead ¶
AlertsMarkAllAsRead marks all of a user's unread alerts as read.
Because this method acts only on alerts belonging to the current user, it's impossible for one user to mark another user's alerts as read. (Unless the user logs in under someone else's account.)
POST /alerts/mark_all_as_read
func AlertMarkAsReadXHR ¶
AlertsMarkAsReadXHR handles an AJAX request to mark alerts as read. The PUT body should contain a csrf token and param called "id__in" whose value is a list of alert ids. This will mark each of those alerts as read by the current user.
Because this method acts only on alerts belonging to the current user, it's impossible for one user to mark another user's alerts as read. (Unless the user logs in under someone else's account.)
PUT /alerts/mark_as_read
func AlertMarkAsUnreadXHR ¶
AlertsMarkAsUnreadXHR handles an AJAX request to mark alerts as unread. The PUT body should contain a csrf token and param called "id__in" whose value is a list of alert ids. This will mark each of those alerts as unread by the current user.
Because this method acts only on alerts belonging to the current user, it's impossible for one user to mark another user's alerts as unread. (Unless the user logs in under someone else's account.)
PUT /alerts/mark_as_unread
func AlertShow ¶
AlertShow shows the AlertView with the specified id for the specified user. Note that the AlertView table contains multiple entries for each Alert ID. But each alert goes only once to each recipient, so the combination of AlertID + UserID (recipient) is unique. GET /alerts/show/:id
func CreateNewAccountAlert ¶
func CreateNewAccountAlert(req *Request, newUser *pgmodels.User, token string) (*pgmodels.Alert, error)
CreateNewAccountAlert creates an alert telling a newly added user that they now have an APTrust account. The alert includes a link for the user to set a custom password.
func CreatePasswordChangedAlert ¶
CreatePasswordChangedAlert creates an alert telling a user that their password has been changed. It should say who changed the password, from where (IP address) and when.
func CreatePasswordResetAlert ¶
func CreatePasswordResetAlert(req *Request, userToEdit *pgmodels.User, token string) (*pgmodels.Alert, error)
CreatePasswordResetAlert creates an alert telling a user to reset their password. The alert's email body includes a link with a password-reset token. These alerts should be generated when a user clicks the "Forgot Password" link on the login page and when an admin creates a new user account. In each case, the user clicks the email link and then has to set a new password.
Note that the token in the URL is random but unencrypted. The one in the DB is encrypted, so stealing it will do an attacker no good.
func DashboardShow ¶
func DeletionRequestApprove ¶
DeletionRequestApprove handles the case where an institutional admin approves a deletion request. Note that the token comes in through the post form here, not through the URL.
POST /deletions/approve/:id
func DeletionRequestCancel ¶
DeletionRequestCancel handles the case where an institutional admin cancels (rejects) a file deletion request. Token comes in through post form, not query string.
POST /deletions/cancel/:id
func DeletionRequestIndex ¶
DeletionRequestIndex shows list of deletion requests. GET /deletions
func DeletionRequestReview ¶
DeletionRequestReview displays a page on which an institutional admin can review a requested file deletion and choose whether to approve or cancel it.
GET /deletions/review/:id?token=<token>
func DeletionRequestShow ¶
DeletionRequestShow shows the deletion request with the specified id.
Note that this shows a read-only view of the request. It does not include the Approve/Cancel buttons. This read-only view may be available to users who do not have permission to initiate, approve, or cancel deletion requests but who still need a read-only view of the requests that have been submitted.
Deletions apply to files and/or intellectual objects. The methods for initiating, approving and rejecting deletion requests are in the Generic Files Controller (for files) and the Intellectual Objects Controller (for objects).
GET /deletions/show/:id
func DepositReportShow ¶
DepositReportShow shows the deposits report.
Note that this does not follow the usual pattern for list/show pages, where most of the work is done by Request or Request.LoadResourceList because this is a reporting query that is not running against a basic table or view. The query in pgmodels.DepositStats is more complex, so we do a little more manual work here.
GET /reports/deposits
func ErrorShowModal ¶
func GenericFileIndex ¶
GenericFileIndex shows list of objects. GET /files
func GenericFileInitDelete ¶
GenericFileInitDelete occurs when user clicks the button confirming they want to delete a file. This creates a deletion confirmation message, which will be emailed to institutional admins for approval.
POST /files/init_delete/:id
func GenericFileInitRestore ¶
GenericFileInitRestore creates a file restoration request, which is really just a WorkItem that gets queued. Restoration can take seconds or hours, depending on where the file is stored and how big it is. POST /files/init_restore/:id
func GenericFileRequestDelete ¶
GenericFileRequestDelete shows a message asking if user really wants to delete a file. DELETE /files/request_delete/:id
func GenericFileRequestRestore ¶
GenericFileRequestRestore shows a message asking whether user really wants to restore a file. GET /files/request_restore/:id
func GenericFileShow ¶
GenericFileShow returns the object with the specified id. GET /files/show/:id
func InitObjectRestoration ¶
func InstitutionCreate ¶
InstitutionCreate a new institution. Handles submission of new institution form. POST /institutions/new
func InstitutionDelete ¶
InstitutionDelete deletes a user. DELETE /institutions/delete/:id GET /institutions/delete/:id
func InstitutionEdit ¶
InstitutionEdit shows a form to edit an exiting institution. GET /institutions/edit/:id
func InstitutionEditPrefs ¶
InstitutionEditPrefs shows a form to edit institutional preferences. GET /institutions/edit_preferences/:id
func InstitutionIndex ¶
InstitutionIndex shows list of institutions. GET /institutions
func InstitutionNew ¶
InstitutionNew returns a blank form for the institution to create a new institution. GET /institutions/new
func InstitutionShow ¶
InstitutionShow returns the institution with the specified id. GET /institutions/show/:id
func InstitutionUndelete ¶
InstitutionUndelete reactivates an institution. GET /institutions/undelete/:id
func InstitutionUpdate ¶
InstitutionUpdate saves changes to an exiting institution. PUT /institutions/edit/:id
func InstitutionUpdatePrefs ¶
InstitutionUpdatePrefs saves institutional preferences. PUT /institutions/edit_preferences/:id
func IntellectualObjectEvents ¶
This is called when user pages through events on the intellectual object detail page. This returns an HTML fragment, not an entire page.
GET /objects/events/:id (intellectual object id)
func IntellectualObjectFiles ¶
This is called when user pages through files on the intellectual object detail page. This returns an HTML fragment, not an entire page.
GET /objects/files/:id (intellectual object id)
func IntellectualObjectIndex ¶
IntellectualObjectIndex shows list of objects. GET /objects
func IntellectualObjectInitDelete ¶
IntellectualObjectInitDelete creates an object deletion request. This request must be approved by an administrator at the depositing institution before the deletion will actually be queued.
POST /objects/init_delete/:id
func IntellectualObjectInitRestore ¶
IntellectualObjectInitRestore creates an object restoration request, which is really just a WorkItem that gets queued. Restoration can take seconds or hours, depending on where the object is stored and how big it is. POST /objects/init_restore/:id
func IntellectualObjectRequestDelete ¶
IntellectualObjectRequestDelete shows a message asking if the user really wants to delete this object. GET /objects/request_delete/:id
func IntellectualObjectRequestRestore ¶
IntellectualObjectRequestRestore shows a message asking if the user really wants to delete this object. GET /objects/request_restore/:id
func IntellectualObjectShow ¶
IntellectualObjectShow returns the object with the specified id. GET /objects/show/:id
func InternalMetadataIndex ¶
InternalDataIndex returns data from the schema_migrations and ar_internal_metadata tables. GET /internal_metadata
func NsqInit ¶
NsqInit creates the initial NSQ topics and channels, so we'll have somthing to look at. Outside of our dev and test machines, these topics and channels are created by the queue workers that push items into NSQ.
func OTPTokenIsExpired ¶
func PremisEventIndex ¶
PremisEventIndex shows list of objects. GET /events
func PremisEventShow ¶
PremisEventShow returns the object with the specified id. GET /events/show/:id
func PremisEventShowXHR ¶
PremisEventShowXHR returns the PREMIS event with the specified ID as an HTML fragment suitable for loading into a modal dialog or other existing HTML element. This does not return a full page with header and footer.
GET /events/show_xhr/:id
func ShowOpenSubMenu ¶
func ShowOpenSubMenu(auth *middleware.ResourceAuthorization) bool
func SignInUser ¶
SignInUser signs the user in with email and password. If user has two-factor auth, this is the first step of login.
func StatusCodeForError ¶
StatusCodeForError returns the http.StatusCode for the specified error. If the error doesn't map to a code, this returns 500 by default.
func UserAuthyRegister ¶
UserRegisterWithAuthy registers a user with Authy.
func UserChangePassword ¶
UserChangePassword changes a user's password. The user gets to specify what the new password will be.
POST /users/change_password/:id
func UserComplete2FASetup ¶
UserComplete2FASetup receives a form from UserInit2FASetup. If user chooses SMS, we need to send them a code via SMS and have them enter it here to confirm. If they choose Authy, we need to register them if they're not already registered.
POST /users/2fa_setup
func UserCompletePasswordReset ¶
UserCompletePasswordReset allows a user to complete the password reset process. Note that this is one of the few pages that does not require a login.
POST /users/complete_password_reset/:id
func UserCompleteSMSSetup ¶
func UserConfirmPhone ¶
UserConfirmPhone accepts the form from UserComplete2FASetup.
POST /users/confirm_phone
func UserCreate ¶
UserCreate a new user. Handles submission of new user form. POST /users/new
func UserDelete ¶
UserDelete deletes a user. DELETE or POST /users/delete/:id
func UserGenerateBackupCodes ¶
UserGenerateBackupCodes generates a set of five new, random backup codes and displays them to the user.
POST /users/backup_codes
func UserGetAPIKey ¶
UserGetAPIKey issues a new API key for the user, which replaces the user's existing API key. This key will be displayed once only.
POST /users/get_api_key/:id
func UserInit2FASetup ¶
UserInit2FASetup shows a page on which a user chooses their preferred two-factor auth method (or they can choose None and turn off two-factor).
GET /users/2fa_setup
func UserInitPasswordReset ¶
UserInitPasswordReset resets a user's password to something random and sends them an email with a link that has an embedded login token. When they follow the link, they'll be automatically logged in and will have to choose a new password.
TODO: This should be POST or PUT, not GET
GET /users/init_password_reset/:id
func UserMyAccount ¶
UserMyAccount displays the user's account info. From this page, they can see account details, change their password, and get an API key.
GET /users/my_account
func UserSendForgotPasswordMessage ¶
POST /users/forgot_password
func UserShowChangePassword ¶
UserShowChangePassword displays the change password page for the user with the specified ID.
GET /users/change_password/:id
func UserShowForgotPasswordForm ¶
GET /users/forgot_password
func UserSignInShow ¶
UserSignInShow shows the user sign-in form. GET /users/sign_in
func UserSignOut ¶
UserSignOut signs the user out. GET /users/sign_out
func UserStartPasswordReset ¶
UserCompletePasswordReset allows a user to enter a token to reset their password. Why not embed the password in the URL? Because https://bit.ly/3u9GWEn.
Note that this is one of the few pages that does not require a login.
GET /users/complete_password_reset/:id
func UserTwoFactorBackup ¶
UserTwoFactorBackup shows the form on which the user can enter a backup code to complete two-factor authentication.
GET /users/2fa_backup/
func UserTwoFactorChoose ¶
UserTwoFactorChoose shows a list of radio button options so a user can choose their two-factor auth method (Authy, Backup Code, SMS). We show this page after a user has entered their email and password, if they have two-factor enabled. This is part of the login process, not part of the setup process.
GET /users/2fa_choose/
func UserTwoFactorGenerateSMS ¶
UserTwoFactorGenerateSMS generates an OTP and sends it via SMS the user.
POST /users/2fa_sms
func UserTwoFactorPush ¶
UserTwoFactorPush initiates a push request to the user's authentication app asking them to approve the login. This method waits for a response from the authentication service. It's a POST to avoid GET spam. POST form includes CSRF token.
POST /users/2fa_push/
func UserTwoFactorVerify ¶
UserTwoFactorVerify verifies the SMS or backup code that the user entered on TwoFactorEnter.
POST /users/2fa_verify/
func UserUndelete ¶
UserUndelete reactivates a user. POST or PUT /users/undelete/:id
func UserUpdate ¶
UserUpdate saves changes to an exiting user. PUT /users/edit/:id
func UserUpdateXHR ¶
UserUpdateXHR handles updates to individual properties of the User object. These come from inline forms on the user view and user list pages. This allows edits to only the following fields:
Name, Email, Phone, Password, Role, Status, and OTPRequiredForLogin.
Note: Unlike most calls in this package, this one returns JSON, not HTML. This is a late addition based on UI mockups.
PUT /users/edit_xhr/:id
func WorkItemEdit ¶
WorkItemEdit shows a form to edit an exiting work item. GET /work_items/edit/:id
func WorkItemIndex ¶
WorkItemIndex shows list of work items. GET /work_items
func WorkItemRedisDelete ¶
WorkItemRedisDelete deletes a WorkItem's Redis record. This is an admin-only feature.
PUT or POST /work_items/redis_delete/:id
func WorkItemRedisIndex ¶
WorkItemRedisIndex shows a list of WorkItems that have records in Redis. This is an admin-only feature.
GET /work_items/redis_list
func WorkItemRequeue ¶
WorkItemRequeue requeues a WorkItem. This is an admin-only feature typically used to recover from system errors.
PUT or POST /work_items/requeue/:id
func WorkItemShow ¶
WorkItemShow returns the work item with the specified id. GET /work_items/show/:id
func WorkItemUpdate ¶
WorkItemUpdate saves changes to an exiting work item. This is an admin-only feature. PUT /work_items/edit/:id
Types ¶
type AlertReadResult ¶
type AlertReadResult struct { Succeeded []int64 `json:"succeeded"` Failed []int64 `json:"failed"` Error string `json:"error"` }
func NewAlertReadResult ¶
func NewAlertReadResult() *AlertReadResult
type Deletion ¶
type Deletion struct { // DeletionRequest is the DeletionRequest. DeletionRequest *pgmodels.DeletionRequest // InstAdmins is the list of institutional admins to be alerted // about this DeletionRequest. One of these admins has to approve // or cancel the request before we move forward. InstAdmins []*pgmodels.User // contains filtered or unexported fields }
Deletion is a helper object for web requests involving the review, approval, and cancellation of deletion requests. This object simply encapsulates a lot of the grunt work required by the GenericFilesController and the IntellectualObjectsController.
func NewDeletionForFile ¶
func NewDeletionForFile(genericFileID int64, currentUser *pgmodels.User, baseURL string) (*Deletion, error)
NewDeletionForFile creates a new DeletionRequest for a GenericFile and returns the Deletion object. This constructor is only for initializing new DeletionRequests, not for reviewing, approving or cancelling existing requests.
func NewDeletionForObject ¶
func NewDeletionForObject(objID int64, currentUser *pgmodels.User, baseURL string) (*Deletion, error)
NewDeletionForObject creates a new DeletionRequest for an IntellectualObject and returns the Deletion object. This constructor is only for initializing new DeletionRequests, not for reviewing, approving or cancelling existing requests.
func NewDeletionForReview ¶
func NewDeletionForReview(deletionRequestID int64, currentUser *pgmodels.User, baseURL, token string) (*Deletion, error)
NewDeletionForReview pulls up information about an existing deletion request that an institutional admin will review before deciding whether to approve or cancel the request.
func (*Deletion) CreateAndQueueWorkItem ¶
CreateAndQueueWorkItem creates and queues a deletion WorkItem. We call this only if the admin approves the DeletionRequest.
func (*Deletion) CreateApprovalAlert ¶
CreateApprovalAlert creates an alert saying that an admin has approved a deletion. This alert goes via email to all admins at the institution that owns the file or object to be deleted.
func (*Deletion) CreateCancellationAlert ¶
CreateCancellationAlert creates an alert saying that an admin has rejected a deletion request. This alert goes via email to all admins at the institution that owns the file or object to be deleted.
func (*Deletion) CreateRequestAlert ¶
CreateRequestAlert creates an alert saying that a user has requested a deletion. This alert goes via email to all admins at the institution that owns the file or object to be deleted. This method is supported only for new deletion requests. If you try to call this on a deletion request you retrieved from the DB, you'll get "operation not supported" because we don't have access to the plaintext confirmation token for the review URL.
func (*Deletion) CreateWorkItem ¶
CreateWorkItem creates a WorkItem describing this deletion. We call this only if the admin approves the deletion.
func (*Deletion) QueueWorkItem ¶
QueueWorkItem sends the WorkItem.ID into the appropriate NSQ topic. We call this after calling CreateWorkItem, and only if the admin approves the deletion.
func (*Deletion) ReadOnlyURL ¶
ReadOnlyURL returns a URL that displays info about the deletion request but does not include buttons to approve or cancel. This view is for the depositor's historical/auditing purposes.
func (*Deletion) ReviewURL ¶
ReviewURL returns the URL for an institutional admin to review this deletion request. Note that the DeletionRequest has a plaintext ConfirmationToken ONLY when created, not when we retrieve it from the database. If you call this method after retrieving a DeletionRequest, you'll get common.ErrNotSupported, because we no longer have access to the plaintext ConfirmationToken. This works only after calling initFileDeletionRequest or initObjectDeletionRequest.
func (*Deletion) WorkItemURL ¶
WorkItemURL returns the URL for the WorkItem for this DeletionRequest. If you call this on a cancelled or not-yet-approved request, there is no WorkItem and you'll get common.ErrNotSupported.
type DepositReportParams ¶
type Request ¶
type Request struct { PathAndQuery string CurrentUser *pgmodels.User GinContext *gin.Context Auth *middleware.ResourceAuthorization TemplateData gin.H Error error }
func NewRequest ¶
func (*Request) BaseURL ¶
BaseURL returns the base of param _url. The base includes the scheme, optional port, and hostname. In other words, the URL stripped of path and query.
func (*Request) GetFilterCollection ¶
func (req *Request) GetFilterCollection() *pgmodels.FilterCollection
GetFilterCollection returns a collection of filters the user wants to apply to an index/list request. These come from the query string. Call the ToQuery() method of the returned FilterCollection to translate query string params to SQL.
func (*Request) LoadResourceList ¶
func (req *Request) LoadResourceList(items interface{}, orderByColumn, direction string, ffConstructor forms.FilterFormConstructor) error
LoadResourceList loads a list of resources for an index page. Param items should be a pointer to a slice of the type of item you want to load (GenericFile, Institution, etc.). Params orderByColumn and direction indicate a default sort order to be applied if the request did not explicitly include a sort order. (I.e. no sort=column__direction on the query string.)
type TwoFactorPreferences ¶
type TwoFactorPreferences struct { OldPhone string NewPhone string OldMethod string NewMethod string User *pgmodels.User }
func NewTwoFactorPreferences ¶
func NewTwoFactorPreferences(req *Request) (*TwoFactorPreferences, error)
func (*TwoFactorPreferences) DoNotUseTwoFactor ¶
func (p *TwoFactorPreferences) DoNotUseTwoFactor() bool
func (*TwoFactorPreferences) MethodChanged ¶
func (p *TwoFactorPreferences) MethodChanged() bool
func (*TwoFactorPreferences) NeedsAuthyConfirmation ¶
func (p *TwoFactorPreferences) NeedsAuthyConfirmation() bool
func (*TwoFactorPreferences) NeedsAuthyRegistration ¶
func (p *TwoFactorPreferences) NeedsAuthyRegistration() bool
func (*TwoFactorPreferences) NeedsConfirmation ¶
func (p *TwoFactorPreferences) NeedsConfirmation() bool
func (*TwoFactorPreferences) NeedsSMSConfirmation ¶
func (p *TwoFactorPreferences) NeedsSMSConfirmation() bool
func (*TwoFactorPreferences) NothingChanged ¶
func (p *TwoFactorPreferences) NothingChanged() bool
func (*TwoFactorPreferences) PhoneChanged ¶
func (p *TwoFactorPreferences) PhoneChanged() bool
func (*TwoFactorPreferences) UseAuthy ¶
func (p *TwoFactorPreferences) UseAuthy() bool
func (*TwoFactorPreferences) UseSMS ¶
func (p *TwoFactorPreferences) UseSMS() bool
Source Files ¶
- account_alert.go
- alerts_controller.go
- dashboard_controller.go
- deletion.go
- deletion_requests_controller.go
- errors.go
- generic_files_controller.go
- institutions_controller.go
- intellectual_objects_controller.go
- internal_data_controller.go
- nsq_controller.go
- premis_events_controller.go
- reports_controller.go
- request.go
- two_factor_controller.go
- two_factor_preferences.go
- ui_components_controller.go
- users_controller.go
- work_items_controller.go