Row rules on grants: accepted for a type they are not registered for, and ignored beside core permissions

Abierto
#3,443 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
csharp

Línea de trabajo

Start with RoleService.ValidateGrant, EffectiveGrant.Applies, and EffectivePermissions.Allows, then review spec 4.8 and the tests for GET /permissions and GET /permissions/row-rules. Add coverage for a row rule registered to a different content type, a row rule beside a non-content permission, and grants limited to another site. Done means the behavior follows the spec and each case has a test.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area:authorization type:bug

Found in the review of #3440 (#3417). Both fail closed or stay within what the caller may hand out; neither is an escalation.

  • A row rule is accepted for a content type it is not registered for. RoleService.ValidateGrant checks rules.Has(name) only. POST /roles with { "permission": "content.person.update", "constraints": { "rowRule": "news" } }, where news is registered for page alone, answers 201. The grant then matches no row (EffectivePermissions.RuleFilter answers null), without a word. The admin can avoid it with typeNames of GET /permissions/row-rules; an API caller gets no FCMS3042.
  • A row rule on a grant of a permission that is not a content permission is accepted and ignored. EffectiveGrant.Applies and EffectivePermissions.Allows do not look at RowRule, so a role with * or users.manage and rowRule: "own-entries" holds the core permissions in full. Spec 4.8 gives a resource-limited * no core permission and says nothing for row rules.
  • No test reads GET /permissions or GET /permissions/row-rules with a grant limited to another site. Every test uses an instance-wide role, so a change of the site passed to the check would pass them all.

Wanted

  • A grant whose row rule is not registered for the content type of its permission is refused with FCMS3042, with a test.
  • A decision, in spec 4.8, on a row rule beside a permission that is not a content permission: refused, or a grant that gives no core permission, with a test.
  • The two tests with a grant limited to another site.

Bundle 27.

Lenguaje dominante
C#
Estrellas
567
Forks
107
Merge medio
1 h 19 min
PR fusionados (30 d)
353

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fluentcms/FluentCMS

Todos los issues de fluentcms/FluentCMS

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.