20d04fc370
* Add a transparency page where regular user accounts can list the roles and permissions that an admin user has access to. It is available by clicking on the "Admin" badge on that user's profile page. * Add additional admin scopes to lock down more functionality: * User feedback and reports * Change logs * User notes and admin notes * Add friendly descriptions to what all the scopes mean in practice. * Don't show admin notification badges to admins who aren't allowed to act on those notifications. * Update the admin dashboard page and documentation for admins.
22 lines
561 B
Go
22 lines
561 B
Go
package config_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"code.nonshy.com/nonshy/website/pkg/config"
|
|
)
|
|
|
|
// TestAdminScopesCount validates that all named admin scopes are
|
|
// returned by the scope list function.
|
|
func TestAdminScopesCount(t *testing.T) {
|
|
var scopes = config.ListAdminScopes()
|
|
if len(scopes) != config.QuantityAdminScopes || len(scopes) != len(config.AdminScopeDescriptions) {
|
|
t.Errorf(
|
|
"The list of scopes returned by ListAdminScopes doesn't match the expected count. "+
|
|
"Expected %d, got %d",
|
|
config.QuantityAdminScopes,
|
|
len(scopes),
|
|
)
|
|
}
|
|
}
|