Commit Graph

9 Commits

Author SHA1 Message Date
Richard Cox 0b2851032e Improve Role Required Indicators/Validation
- RBAC Role type improvements
  - Remove rule 'Non-Resource URL' field. RBAC role type is namespaced, non-resource url's are not.
  - Apply additional validation (
    - rule resource AND api group required, rather than default rule resource, non-resource url or api group required
    - name is required
  - Show Required indicator for all fields (reflecting validation)
- Other Role type improvements
  - Show Required indicator for rule Verbs field
    - This does mean that when the page initially loads we show an empty rule row with required fields... but user can ignore this and successfully save the role anyway. The alternative is to not show an empty rule to begin with... but this forces the user to `Add Resource`. I feel the later is more of an issue than the former.
  - name is required
2021-04-21 13:48:50 +01:00
Richard Cox b777cf04c1 Improve validation for Roles, Fix empty Rule property bug
- Removed unused code (setVerb/getVerb)
- Improve handling of empty strings when setting arrays in a rule
- Remove required field for api groups for non-rancher types (rbac role/cluster role)
  - There's a lot of validation for these types in the backend that would be tricky to do with the current mechanism up front
    - Namespaced roles cannot use non-resource urls
    - Rules with resources must have api groups (and vice versa)
    - Roles with no rules are ok (guessing this is because there's no validation of the inherit role side)
  - So let the api validation do it's thing for the complex cases on submit
- Apply basic rule validation to non-rancher role types
2021-04-16 10:16:28 +01:00
Richard Cox 0036deb72e Apply `redirectUnauthorized: false` when saving roles
- There's situations where the user does not have permision to create certain rules
- In those cases ensure we don't log the user out
2021-04-13 14:09:22 +01:00
Richard Cox a1b512194b Visual bugs
- Role Rule 'Resources' --> 'Resource
- For disabled radio buttons don't show standard grey colour, use the usual ith opacity
- Ensure default locked value is set after setting up subtype
2021-04-13 13:59:39 +01:00
Richard Cox a4fb564413 Remove required indicator for role rules
- These aren't required by the API
2021-04-13 11:55:03 +01:00
Richard Cox fd3850b2e6 Ensure form/yaml cancel/done return to auth roles page 2021-04-13 11:20:37 +01:00
Richard Cox 4b9120adaf Add Create/Edit/View/Detail Pages for RBAC Role and ClusterRole
- Builds on generic way to handle Management Global Roles and Role Templates
- Applies to rbac.authorization.k8s.io.role and rbac.authorization.k8s.io.clusterrole
2021-04-09 16:15:03 +01:00
Richard Cox 502a136c33 Fix role template 'inherited from' & show inherited rules in details page 2021-04-08 15:43:27 +01:00
Richard Cox c2b98c52e5 Display Global/Cluster/Project roles in Auth Product
- Remove spoofed rbac role template type
- Use spoof's base type's management global role and role template types
- Display these types as global, cluster and project tables in auth product
2021-04-08 14:14:19 +01:00