| 123456789101112131415 |
- // Package policies 用户授权
- package policies
- import (
- "github.com/gin-gonic/gin"
- "github.com/runningwater/gohub/app/models/topic"
- "github.com/runningwater/gohub/pkg/auth"
- )
- // CanModifyTopic 登陆用户是否可以修改此 topic
- func CanModifyTopic(c *gin.Context, _topic topic.Topic) bool {
- return _topic.UserID == auth.CurrentUID(c)
- }
|