code: static boolean hasRole( SecurityContext context,
                              String roleName,
                              String repositoryName,
                              String workspaceName ) {
          if (context.hasRole(roleName)) return true;
          roleName = roleName + "." + repositoryName;
          if (context.hasRole(roleName)) return true;
          roleName = roleName + "." + workspaceName;
          return context.hasRole(roleName);
      }
docs: Returns whether the authenticated user has the given role.
  
  @param context the security context
  @param roleName the name of the role to check
  @param repositoryName the name of the repository
  @param workspaceName the workspace under which the user must have the role. This may be different from the current
  workspace.
  @return true if the user has the role and is logged in; false otherwise