Fossil SCM
Do not display Attach button in the forum if the user lacks attach permissions. Problem reported in [forum:e0072028f7|forum post e0072028f7].
Commit
ee59442ab35080e4a59c76d7aa4fe1bf4b2761cd18a339093371960249e897fe
Parent
23b69d340b63855…
1 file changed
+1
-1
+1
-1
| --- src/attach.c | ||
| +++ src/attach.c | ||
| @@ -177,11 +177,11 @@ | ||
| 177 | 177 | int attach_user_may(int rid, int eArtifactType){ |
| 178 | 178 | if( g.perm.Admin ) return 1; |
| 179 | 179 | if( !login_is_individual() ) return 0; |
| 180 | 180 | switch(eArtifactType){ |
| 181 | 181 | case CFTYPE_FORUM: |
| 182 | - return forumpost_is_owner(rid, 0); | |
| 182 | + return g.perm.AttachForum && forumpost_is_owner(rid, 0); | |
| 183 | 183 | case CFTYPE_WIKI: |
| 184 | 184 | return g.perm.ApndWiki && g.perm.Attach; |
| 185 | 185 | case CFTYPE_TICKET: |
| 186 | 186 | return g.perm.ApndTkt && g.perm.Attach; |
| 187 | 187 | case CFTYPE_EVENT: |
| 188 | 188 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -177,11 +177,11 @@ | |
| 177 | int attach_user_may(int rid, int eArtifactType){ |
| 178 | if( g.perm.Admin ) return 1; |
| 179 | if( !login_is_individual() ) return 0; |
| 180 | switch(eArtifactType){ |
| 181 | case CFTYPE_FORUM: |
| 182 | return forumpost_is_owner(rid, 0); |
| 183 | case CFTYPE_WIKI: |
| 184 | return g.perm.ApndWiki && g.perm.Attach; |
| 185 | case CFTYPE_TICKET: |
| 186 | return g.perm.ApndTkt && g.perm.Attach; |
| 187 | case CFTYPE_EVENT: |
| 188 |
| --- src/attach.c | |
| +++ src/attach.c | |
| @@ -177,11 +177,11 @@ | |
| 177 | int attach_user_may(int rid, int eArtifactType){ |
| 178 | if( g.perm.Admin ) return 1; |
| 179 | if( !login_is_individual() ) return 0; |
| 180 | switch(eArtifactType){ |
| 181 | case CFTYPE_FORUM: |
| 182 | return g.perm.AttachForum && forumpost_is_owner(rid, 0); |
| 183 | case CFTYPE_WIKI: |
| 184 | return g.perm.ApndWiki && g.perm.Attach; |
| 185 | case CFTYPE_TICKET: |
| 186 | return g.perm.ApndTkt && g.perm.Attach; |
| 187 | case CFTYPE_EVENT: |
| 188 |