Beispiel #1
0
        private Boolean shouldApprove(IUser objUser)
        {
            User user = (User)objUser;

            if (SiteRole.IsInAdminGroup(user.RoleId))
            {
                return(false);
            }

            ContentSubmitter s = ContentSubmitter.find("User.Id=" + user.Id + " and AppId=" + ctx.app.Id).first();

            return(s == null);
        }
Beispiel #2
0
        private String getRoleName(int submitCount)
        {
            ContentApp           app = ctx.app.obj as ContentApp;
            ContentSubmitterRole sr  = app.GetSubmitterRoleObj();

            if (SiteRole.IsInAdminGroup(ctx.viewer.obj.RoleId))
            {
                return(sr.Editor);
            }

            ContentSubmitter s = ContentSubmitter.find("User.Id=" + ctx.viewer.Id + " and AppId=" + ctx.app.Id).first();

            if (s != null)
            {
                return(sr.getName(s.RoleId));
            }

            if (submitCount > 0)
            {
                return(sr.NeedApproval);
            }

            return("无");
        }