ActionPermissionType Enumeration
Assembly: CodeEffects.Rule.Common.dll
Namespace: CodeEffects.Rule.Common.Models
Summary
Identifies something a user can do in the Rule Repository, and therefore something a host can grant or withhold. There is one member per permission.
Syntax
public enum ActionPermissionType
{
Undefined = 0,
SourceUpdateDetails = 10,
SourceDelete = 11,
SourceVersionUpdateDetails = 20,
SourceVersionGoLive = 21,
SourceVersionTakeOffline = 22,
SourceVersionDelete = 23,
RuleCreate = 30,
RuleUpdateDetails = 31,
RuleDelete = 32,
RuleVersionCreate = 40,
RuleVersionUpdateDetails = 41,
RuleVersionGoLive = 42,
RuleVersionTakeOffline = 43,
RuleVersionRequestApproval = 44,
RuleVersionApproveAndDecline = 45,
RuleVersionDelete = 46,
DraftView = 50,
DraftCreate = 51,
DraftUpdate = 52,
DraftConvert = 53,
DraftDelete = 54,
TestView = 60,
TestRun = 61,
TestCreate = 62,
TestUpdate = 63,
TestDelete = 64,
TestRunBatch = 65,
TestRunProductionCalls = 66,
ValueTemplateCreate = 70,
ValueTemplateUpdate = 71,
ValueTemplateDelete = 72,
EvaluationView = 80,
EvaluationSaveAsTest = 81,
ActivityView = 90,
NoteView = 100,
NoteCreate = 101,
NoteDelete = 102,
AiAssistantUse = 110,
AiRuleEditorUse = 111,
AiConversationViewAll = 112
}
Members
Undefined
Value: 0
Never granted and never checked: a default-valued variable means nothing.
SourceUpdateDetails
Value: 10
The display name and description of a source object.
SourceDelete
Value: 11
Deleting a source object, with everything under it. A person only.
SourceVersionUpdateDetails
Value: 20
The display name and description of a source version.
SourceVersionGoLive
Value: 21
Making a source version live. A person only.
SourceVersionTakeOffline
Value: 22
Taking the live source version offline. Its replacement, another version made live in its place, needs SourceVersionGoLive as well. A person only.
SourceVersionDelete
Value: 23
Deleting a source version that is not live, with the rule versions written against it. A person only.
RuleCreate
Value: 30
A rule and its first version, which are created together.
RuleUpdateDetails
Value: 31
The name and description of a rule. Its shape is fixed at creation.
RuleDelete
Value: 32
Deleting a rule, with its versions. A person only.
RuleVersionCreate
Value: 40
A new version of an existing rule: New Rule Version, Clone, Create Version.
RuleVersionUpdateDetails
Value: 41
The name and description of a rule version.
RuleVersionGoLive
Value: 42
Making a rule version live, at its save or later. A version whose approval is requested needs RuleVersionApproveAndDecline as well. A person only.
RuleVersionTakeOffline
Value: 43
Taking the live rule version offline. Its replacement needs RuleVersionGoLive as well. A person only.
RuleVersionRequestApproval
Value: 44
Requesting approval for a rule version, at its save or later. Superseded by RuleVersionGoLive: a user who may make versions live is never asked to request it.
RuleVersionApproveAndDecline
Value: 45
Approving and declining requests for approval. Requires RuleVersionGoLive. A person only.
RuleVersionDelete
Value: 46
Deleting a rule version that is not live. A person only.
DraftView
Value: 50
The Drafts grid, draft dialogs, and every way into them.
DraftCreate
Value: 51
Creating a draft.
DraftUpdate
Value: 52
Keep as Draft: the rule and the details.
DraftConvert
Value: 53
Turning a draft into a rule version. Also needs RuleCreate or RuleVersionCreate, by the draft's kind.
DraftDelete
Value: 54
Deleting a draft. A person only.
TestView
Value: 60
The Tests grid, saved tests, value templates, and every way into them.
TestRun
Value: 61
Running a test in the Test dialog, saved or not.
TestCreate
Value: 62
Creating a test.
TestUpdate
Value: 63
Updating a test.
TestDelete
Value: 64
Deleting a test.
TestRunBatch
Value: 65
The Tests grid's batch runner.
TestRunProductionCalls
Value: 66
Running a test that would call production methods: in-rule methods with no test method and no return value set. Without it, such a test is skipped in a batch and refused in the Test dialog.
ValueTemplateCreate
Value: 70
Creating a value template.
ValueTemplateUpdate
Value: 71
Updating a value template.
ValueTemplateDelete
Value: 72
Deleting a value template.
EvaluationView
Value: 80
The Live Evaluations grid, the Result dialogs of evaluations, and every way into them.
EvaluationSaveAsTest
Value: 81
Save as Test on the Result dialog of an evaluation.
ActivityView
Value: 90
The User Activity grid, activity dialogs, and every way into them.
NoteView
Value: 100
The Internal Notes tab on every dialog, read only.
NoteCreate
Value: 101
Creating a note.
NoteDelete
Value: 102
Deleting any note, whoever wrote it.
AiAssistantUse
Value: 110
The AI button and the AI Assistant dialog. The host must also register at least one model for the request: without one there is no assistant, whatever the set says. The assistant acts for the person and can do only what the rest of the set allows, under the agent rules: never go live, approve, decline, or delete.
AiRuleEditorUse
Value: 111
The AI Rule Editor tab beside every standard Rule Editor tab. Needs a registered assistant as well. The tab never saves: a rule it builds is saved through the dialog's own buttons, under their own permissions.
AiConversationViewAll
Value: 112
Reading every user's AI Assistant conversations, their attachments, and the Usage tab. Read-only and unrecorded. Requires AiAssistantUse. Never goes to an agent or a service.
The set is flat: a list of these values, read according to an ActionPermissionMode, handed to the Rule Repository's configuration or answered by its permission check on every request. How the members depend on each other is the Repository's own map: withholding a permission withholds every permission that requires it.
The values are a contract. A host stores them in its own roles table or configuration, to decide what the signed-in user may do. An existing member is never renumbered or reused for something else, and new members are appended. The numbers are grouped by object in tens, and the gaps are intentional.
The four core objects (source objects, source versions, rules, and rule versions) have no view permission: every Rule Repository user sees their grids and opens their dialogs. Drafts, tests, evaluations, user activity, and notes have one, and without it everything about them is hidden and withheld.
Creating a source object or a source version is deliberately absent: both are the host's own doing, never a user's. Some actions are a person's only, whatever the set says: making a version live or taking it offline, approving, declining, and deleting.
The enumeration lives in the Common assembly, not in the Repository, so that code which cannot reference the Repository can carry and check a set of permissions.
Example
using CodeEffects.Rule.Common.Models;
// A reviewer who may read tests and run them, but nothing else
var mode = ActionPermissionMode.AllowOnly;
var list = new[]
{
ActionPermissionType.TestView,
ActionPermissionType.TestRun
};