package com.springboot.auth.authorization.oauth2.authority;

/*
 **********************************************
 *      DATE           PERSON       REASON
 *    2021-01-05          FXY        Created
 **********************************************
 */


import lombok.AllArgsConstructor;
import org.springframework.security.core.GrantedAuthority;

/**
 * 根据getter方法进行序列化的
 */
@AllArgsConstructor
public class CustomGrantedAuthority implements GrantedAuthority {

    private final String company;
    private boolean isDefault;

    /**
     * 后期可换为角色编号
     *
     * @return
     */
    @Override
    public String getAuthority() {
        return company;
    }

    public boolean isDefault() {
        return isDefault;
    }
}
